<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useVaStoreHook } from "@/store/modules/va";
import WindowsPng from "@/assets/other/windows2.png";

const vaStore = useVaStoreHook();

const appList = ref<[]>([]);
onMounted(() => {});
const clickCard = (item: AppDetailT) => {
  vaStore.openAppForReuse(item.appIssue.appId);
};
</script>

<template>
  <div>
    <el-dialog v-model="vaStore.showUserDesktopAppList" title="应用列表">
      <el-row>
        <div
          @click="clickCard(item)"
          v-for="item in appList"
          :key="item.appIssue.appId"
          class="app-div"
        >
          <img
            class="app-img"
            :src="
              item.appIssue.icon.length > 1 ? item.appIssue.icon : WindowsPng
            "
          />
          <div class="app-name-div">
            {{ item.appIssue.alias }}
          </div>
        </div>
      </el-row>
    </el-dialog>
  </div>
</template>

<style scoped>
.app-div {
  width: 100px;
  height: 154px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  margin-right: 20px;
  cursor: pointer;
}

.app-div:hover {
  border: 1px solid rgb(247, 244, 245);
  font-size: 18px;
  background-color: rgb(244, 247, 242);
}

.app-img {
  width: 75px;
  height: 75px;
}

.app-name-div {
  width: 100px;

  display: -webkit-box;
  text-align: center;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
</style>
